package thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        /*
        System.out.println("开始");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("结束");
         */
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入循环次数");
        for (int i = scanner.nextInt(); i >0; i--){
            try {
                Thread.sleep(1000);
                System.out.println(i-1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("结束");
    }
}
